package 重要代码;

import java.util.Arrays;

public class 选择排序 {
    public static void main(String[] args) {
        int[] arr = {1, 3, 5, 6, 2, 7, 3, 6};


        System.out.println(Arrays.toString(sort01(arr)));


    }

    public static int[] sort01(int[] arr){
        if (arr==null|| arr.length==0){
            return new int [] {-1};

        }
        for (int i = 0; i < arr.length; i++) {
          for (int j = i+1; j < arr.length; j++) {
               if (arr[i] > arr[j]) {
                   arr[i]=arr[i]^arr[j];
                   arr[j]=arr[i]^arr[j];
                   arr[i]=arr[i]^arr[j];
                }

            }

        }
       return arr;

    }
}
